import _fetch from './request'
// import { getLocal } from '@/utils/local'
// 获取用户信息
function auInfo (noError = false) {
  return _fetch({
    url: '/au/info',
    method: 'get',
    needToken: true,
    noError: true //不需要处理错误(别处理401 403)  false要处理错误
    /*   headers: {
      authorization: `Bearer ${getLocal('token')}`
    } */
  })
}

// 修改用户资料
function auEdit (data) {
  return _fetch({
    url: '/au/edit',
    method: 'post',
    needToken: true,
    data //data:data
  })
}

// 上传图片
function upload (data) {
  return _fetch({
    url: '/upload',
    method: 'post',
    needToken: true,
    data
  })
}
export { auInfo, auEdit, upload }
